import {Routes} from 'Shared/utils/routeManager';
import {formatMessage} from './intl';

const routes = new Routes({
    query: {
        url: '/',
        title: formatMessage({
            id: 'routes.query',
            defaultMessage: '查询'
        })
    },
    detail: {
        url: '/:id/detail',
        title: formatMessage({
            id: 'routes.detail',
            defaultMessage: '详情'
        }),
        format: '/{0}/detail'
    },
    add: {
        url: '/add',
        title: formatMessage({
            id: 'routes.add',
            defaultMessage: '新增'
        }),
    },
    update: {
        url: '/:id/update',
        title: formatMessage({
            id: 'routes.update',
            defaultMessage: '编辑'
        }),
        format: '/{0}/update'
    },
    receive: {
        url: '/:id/receive',
        title: formatMessage({
            id: 'routes.receive',
            defaultMessage: '到款登记'
        }),
        format: '/{0}/receive'
    },
    financeApprove: {
        url: '/:id/financeApprove',
        title: formatMessage({
            id: 'routes.financeApprove',
            defaultMessage: '财务审核'
        }),
        format: '/{0}/financeApprove'
    },
    approve: {
        url: '/:id/approve',
        title: formatMessage({
            id: 'routes.approve',
            defaultMessage: '大区审核'
        }),
        format: '/{0}/approve'
    },
    draft: {
        url: '/:id/draft',
        title: formatMessage({
            id: 'routes.draft',
            defaultMessage: '草本转正本'
        }),
        format: '/{0}/draft'
    },
    history: {
        url: '/history',
        title: formatMessage({
            id: 'routes.history',
            defaultMessage: '历史查询'
        }),
    },
    detailhistory: {
        url: '/:id/detailhistory',
        title: formatMessage({
            id: 'routes.detailhistory',
            defaultMessage: '详情'
        }),
        format: '/{0}/detailhistory'
    }
});

export default routes;
